package top.asteam.springcloud.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import top.asteam.springcloud.entity.CommonResult;
import top.asteam.springcloud.entity.Payment;

import java.util.concurrent.TimeUnit;

/**
 * @Author Rock Wang
 * @Time 2021/4/19
 */
@FeignClient(value = "cloud-payment-service")
public interface IPaymentFeignService {

    /**
     * 通过id获取支付信息
     * @param id
     * @return
     */
    @GetMapping("/data/payment/getById")
    CommonResult<Payment> getById(@RequestParam("id") Long id);

    /**
     * 测试超时
     * @return
     */
    @GetMapping("/data/payment/timeout")
    String PaymentFeignTimeout();
}